package com.jctrip.hotel.source.xxl.wehotel;

import com.jctrip.hotel.common.constant.XxlJobNameConstant;
import com.jctrip.hotel.source.service.wehotel.WeHotelTaskService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: zxy
 * @CreateTime: 2023-09-10 20:51
 * @Description:
 */
@Component
@Slf4j
public class SyncWehotelRoomRepairTaskPushXxlJob extends IJobHandler {
    @Resource
    private WeHotelTaskService weHotelTaskService;

    @Override
    @XxlJob(XxlJobNameConstant.SYNC_WEHOTEL_ROOM_REPAIR_TASK_PUSH)
    public void execute() throws Exception {
        XxlJobHelper.log(XxlJobNameConstant.SYNC_WEHOTEL_ROOM_REPAIR_TASK_PUSH + " xxl job start");
        try {
            weHotelTaskService.syncWehotelRoomRepairPush();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        XxlJobHelper.log(XxlJobNameConstant.SYNC_WEHOTEL_ROOM_REPAIR_TASK_PUSH + " xxl job end");
    }
}
